g1 = 100
g2 = [1,2,3]

def func():
    global g1
    g1 = 200

    global g2
    g2.append(4) # 使用g2变量.
    g2 = [100,200] # 修改变量 (地址值发生了改变.)


func()
print(g1) # 100
print(g2) # [1, 2, 3, 4]